<template>
    <!-- 饼图 -->
    <div class="app-container">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <!-- <el-tab-pane label="咨询师管理" name="first" v-hasPermi="['psy:consbasic:list']">
                <consultant></consultant>
            </el-tab-pane> -->
            <el-tab-pane label="咨询师管理" name="first" v-hasPermi="['psy:consbasic:list']" v-if="userInfor.permissions.includes('psy:consbasic:list')">
                <consultant></consultant>
            </el-tab-pane>
            <el-tab-pane label="黑名单设置" name="second" v-hasPermi="['psy:blacklist:list']" v-if="userInfor.permissions.includes('psy:blacklist:list')">
                <blacklist></blacklist>
            </el-tab-pane>
            <el-tab-pane label="留言敏感词设置" name="third">
                <sensitive></sensitive>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
  
<script>
import consultant from '@/views/psychological/components/consultant.vue';
import blacklist from '@/views/psychological/components/blacklist.vue';
import sensitive from '@/views/psychological/components/sensitive.vue';
export default {
    components: {
        consultant,blacklist,sensitive
    },
    data() {
        return {
            activeName: 'first'
        }
    },
    computed: {
    userInfor() {
      return this.$store.state.user;
    }
  },
    created() {
        // console.log(this.userInfor.permissions.includes('psy:consbasic:list'),"this.userInfor.permissions.includes('psy:consbasic:list')")
        if(this.userInfor.permissions.includes('psy:consbasic:list') || this.userInfor.permissions.includes('psy:blacklist:list')) {
            this.activeName = 'first'
        }else {
            this.activeName = 'third'
        }

    },
    methods: {
        handleClick(tab, event) {
            // console.log(tab, event);
        }
    }
};
</script>
  
<style lang="scss" scoped></style>